package com.wjh.mirna.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wjh.mirna.http.Response;
import com.wjh.mirna.model.Score;
import com.wjh.mirna.service.impl.ScoreServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

@RestController
@RequestMapping("/api/score")
public class ScoreController {
    @Autowired
    ScoreServiceImpl scoreService;
    @GetMapping("/queryScore")
    public Response queryScore(int pageNum,int size,Score score){
       Page page = scoreService.queryScore(pageNum,size, score);
        return Response.ok(page);
    }
    @GetMapping("/export")
    public Response export(Score score, HttpServletResponse response){
        scoreService.export(score,response);
        return Response.ok();
    }
}
